#include <iostream>
using namespace std;
class Ancestor
{
	string Aname;
	char Agender;
public:
	Ancestor(string name,char gender):Aname(name),Agender(gender) 
	{
		cout << "The Ancestor is constructed!" << endl;
	}
	void displayAncestor() 
	{
		cout << "The information of my Ancestor is : " << Aname << " " << Agender << endl;
	}
	~Ancestor()
	{
		cout << "The Ancestor is unconstructed!" << endl;
	}
};
class GrandFather : public Ancestor
{
	string Gname;
	char Ggender;
public:
	GrandFather(string name, char gender, string name2, char gender2) :Ancestor(name, gender), Gname(name2), Ggender(gender2)
	{
		cout << "The GrandFather is constructed!" << endl;
	}
	void displayGrandFather()
	{
		Ancestor::displayAncestor();
		cout << "The information of my GrandFather is : " << Gname << " " << Ggender << endl;
	}
	~GrandFather()
	{
		cout << "The GrandFather is unconstructed!" << endl;
	}
};

class Father : public GrandFather
{
	string Fname;
	char Fgender;
public:
	Father(string name, char gender, string name2, char gender2, string name3, char gender3) :GrandFather(name, gender, name2, gender2), Fname(name3), Fgender(gender3)
	{
		cout << "The Father is constructed!" << endl;
	}
	void displayFather()
	{
		GrandFather::displayGrandFather();
		cout << "The information of my Father is : " << Fname << " " << Fgender << endl;
	}
	~Father()
	{
		cout << "The Father is unconstructed!" << endl;
	}
};

class Brother : public Father
{
	string Bname;
	char Bgender;
public:
	Brother(string name, char gender, string name2, char gender2, string name3, char gender3, string name4, char gender4) :Father(name, gender, name2, gender2, name3, gender3), Bname(name4), Bgender(gender4)
	{
		cout << "The Brother is constructed!" << endl;
	}
	void displayBrother()
	{
		Father::displayFather();
		cout << "The information of my Brother is : " << Bname << " " << Bgender << endl;
	}
	~Brother()
	{
		cout << "The Brother is unconstructed!" << endl;
	}
};

class Sister : public Father
{
	string Sname;
	char Sgender;
public:
	Sister(string name, char gender, string name2, char gender2, string name3, char gender3, string name4, char gender4) :Father(name, gender, name2, gender2, name3, gender3), Sname(name4), Sgender(gender4)
	{
		cout << "The Sister is constructed!" << endl;
	}
	void displaySister()
	{
		Father::displayFather();
		cout << "The information of my Sister is : " << Sname << " " << Sgender << endl;
	}
	~Sister()
	{
		cout << "The Sister is unconstructed!" << endl;
	}
};

class Me : public Father
{
	string Mname;
	char Mgender;
	Brother bro;
	Sister  sis;
public:
	Me(string name, char gender, string name2, char gender2, string name3, char gender3, string name4, char gender4, Brother brother, Sister  sister) :Father(name, gender, name2, gender2, name3, gender3), Mname(name4), Mgender(gender4), sis(sister), bro(brother)
	{
		cout << "The Me is constructed!" << endl;
	}
	void displayMe()
	{
		Father::displayFather();
		bro.displayBrother();
		sis.displaySister();
		cout << "The information of my Me is : " << Mname << " " << Mgender << endl;
	}
	~Me()
	{
		cout << "The Me is unconstructed!" << endl;
	}
};

void main() {
	Brother bro("ZX", 'M', "ZF", 'M', "FQ", 'M', "Bro", 'M');
	Sister  sis("ZX", 'M', "ZF", 'M', "FQ", 'M', "Sis", 'F');
	Me me("ZX", 'M', "ZF", 'M', "FQ", 'M', "Me", 'M', bro, sis);
	me.displayMe();
}